from itertools import count
import random
red=0
yellow=0
green=0
count=red+yellow+green
print("红球3个，黄球3个，绿球6个,每次任意8个球")
print("请问您想随机选几次")
while 1:
    cishu=int(input())
    for i in range(cishu):
        count=0
        print("第%d次选择："%(i+1),end="")
        while count!=8:
            red=random.randint(1,3)
            yellow=random.randint(1,3)
            green=random.randint(2,6)
            count=red+yellow+green
        print("红球%d个，黄球%d个，绿球%d个"%(red,yellow,green))
    break

